package priv.pront.code.lanqiao.competition.course.date0330;

import java.util.Scanner;

public class 和为T2 {

    static int n, count, T;
    static int a[] = new int[22];
    static int b[] = new int[22];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        T = sc.nextInt();
        count = 0;
        findA(n - 1, 0, 0);
        System.out.println(count);
    }

    public static void findA(int x, int y, int sum) {
        if (x < 0)
            return;
        findA(x - 1, y, sum);
        b[y] = a[x];
        sum += a[x];
        if (sum == T) {
            count++;
            p(y);
        }
        findA(x - 1, y + 1, sum);
    }

    public static void p(int y) {
        int i;
        for (i = y; i >= 0; i--) {
            System.out.print(b[i] + " ");
        }
        System.out.println();
    }
}
